﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Wintellect.LiveFx.Cloudboard
{
  public enum LiveFrameworkStatus
  {
    Available,
    Unavailable,
    Authenticated,
    NotAuthenticated
  }

  public class MeshStatus
  {
    private static MeshStatus instance;
    private LiveFrameworkStatus liveFrameworkStatus;

    public event EventHandler ConnectionStatusChanged;
    private MeshStatus()
    {
    }

    public MeshStatus Instance
    {
      get
      {
        if (MeshStatus.instance == null)
        {
          MeshStatus.instance = new MeshStatus();
        }
        return MeshStatus.instance;
      }
    }

    public LiveFrameworkStatus LiveFrameworkStatus
    {
      get
      {
        return this.liveFrameworkStatus;
      }
      set
      {
        if (this.liveFrameworkStatus != value)
        {
          this.liveFrameworkStatus = value;
          this.OnConnectionStatusChanged();
        }
      }
    }

    private void OnConnectionStatusChanged()
    {
      if (this.ConnectionStatusChanged != null)
      {
        this.ConnectionStatusChanged(this, new EventArgs());
      }
    }
  }
}
